package com.longtop.sp.mapdao.impl;

import java.io.Serializable;
import java.sql.Types;
import java.util.UUID;

import com.longtop.sp.mapdao.IPrimaryGenerator;

public class UUIDPrimaryGenerator implements IPrimaryGenerator {

	public Serializable genPK() {
		return UUID.randomUUID().toString();
	}

	public boolean isMatch(String type) {
		return type.equals(Types.CHAR) || type.equals(Types.VARCHAR)
				|| type.equals(Types.LONGVARCHAR)
				|| type.equalsIgnoreCase("COMMON");
	}

}